//
//  APIClient.h
//  CameraRuler
//
//  Created by LiuHuanQing on 15/3/20.
//  Copyright (c) 2015年 HQ_L. All rights reserved.
//

#import "APIClient.h"
//服务器配置表


#if 1
#define AD_WEB_HOST           @"https://app.solot.co"
#define WEB_HOST_V2           @"https://testapi.solot.co/"
#define PHOTO_POST_HOST       @"https://testapi.solot.co/v1/storage/"
#define VIDEO_GET_HOST        @"https://v.solot.co/"
#define Weather_Host          @"https://app.solot.co/"
#define RES_HOST              @"https://res1.solot.co"

#define STATIC_HTML           @"https://s.solot.co/"
#define QRCodeBaseURL         @"https://d.solot.co/s/"
#define ALIPAY_NOTIFY_URL     @"https://testapi.solot.co/bill/payback/alipay"

#define SOCKET_HOST @"gate.solot.co"
#define SOCKET_PORT @"3014"


#define AD_URL_PATH         @"adDetail.html?id="    //广告
#define STORY_URL_PATH      @"stories.html?id="     //贴子
#define MAGAZINE_URL_PATH      @"magazine.html?id="     //杂志
#define ARTICLE_URL_PATH      @"stories_c.html?id="     //长文章
#define ACTIVITY_URL_PATH   @"activity.html?id="    //活动
#define RECORD_URL_PATH     @"fishRecord.html?id="  //渔获记录

//暂定
#define SHIP_URLPATH        @"ship.html?id="        //船
#define FISH_URLPATH        @"fish.html?id="        //鱼资料

#define MERCHANT_URLPATH    @"merchant.html?id="    //商家
#define FISHPLACE_URLPATH   @"fishplace.html?id="   //钓场
#define PRIMER_URLPATH      @"primer.html?id="      //教程
#define LEVEL_UP_USER       @"levelUse.html?id="    //用户等级提升
#define LEVEL_UP_SKILL      @"levelSkill.html?id="  //用户钓鱼技能等级提升
#define LEVEL_UP_CER        @"levelCer.html?id="    //用户获得证书
#define RECORD_ANALYSIS     @"recordAnalysis.html?id=" //足迹
#define QUEATIONS_ANSWER    @"question.html?id=" //问答

#else

#define AD_WEB_HOST           @"https://app.catches.com"
#define WEB_HOST_V2           @"https://api0.catches.com/"
#define PHOTO_POST_HOST       @"https://api0.catches.com/v1/storage/"
#define VIDEO_GET_HOST        @"https://v0.catches.com/"

#define RES_HOST              @"https://api0.catches.com"

#define Weather_Host          @"https://api0.catches.com"
#define STATIC_HTML           @"https://s0.catches.com/"
#define ALIPAY_NOTIFY_URL       @"https://api0.catches.com/bill/payback/alipay"
#define QRCodeBaseURL         @"https://d.catches.com/s/"

#define SOCKET_HOST @"gate0.catches.com"
#define SOCKET_PORT @"3013"

#define AD_URL_PATH         @"adDetail.html?id="    //广告
#define STORY_URL_PATH      @"stories.html?id="     //贴子
#define MAGAZINE_URL_PATH      @"magazine.html?id="     //杂志
#define ARTICLE_URL_PATH      @"stories_c.html?noteid="     //长文章
#define ACTIVITY_URL_PATH   @"activity.html?id="    //活动
#define RECORD_URL_PATH     @"fishRecord.html?id="  //渔获记录

//暂定
#define SHIP_URLPATH        @"ship.html?id="        //船
#define FISH_URLPATH        @"fish.html?id="        //鱼资料

#define MERCHANT_URLPATH    @"merchant.html?id="    //商家
#define FISHPLACE_URLPATH   @"fishplace.html?id="   //钓场
#define PRIMER_URLPATH      @"primer.html?id="      //教程
#define LEVEL_UP_USER       @"levelUse.html?id="    //用户等级提升
#define LEVEL_UP_SKILL      @"levelSkill.html?id="  //用户钓鱼技能等级提升
#define LEVEL_UP_CER        @"levelCer.html?id="    //用户获得证书
#define RECORD_ANALYSIS     @"recordAnalysis.html?id=" //足迹
#define QUEATIONS_ANSWER    @"question.html?id=" //问答

#endif

#define APP_ID @"angler"


typedef void (^HQCompleteBlock)(NSError *error);
typedef void (^HQCompleteDataBlock)(id data,NSError *error);
typedef void (^HQCompleteArrayBlock)(NSArray *datas,NSError *error);
typedef void (^HQCompleteArraysBlock)(NSArray *datas1,NSArray *datas2,NSError *error);

typedef void(^HQImageHandlerSuccess)(NSString *imageId, UIImage *image);
typedef void(^HQFileHandlerSuccess)(NSURL *filePath);
typedef void(^HQVideoHandlerSuccess)(NSString *imagefilepath, NSString *videofilepath, NSString *imageurl, NSString *videourl);

typedef void(^HQProgressHandler)(CGFloat progress);
typedef void(^HQImageHandlerFailure)(NSHTTPURLResponse *response ,NSError *error);
typedef void(^HQHandlerFailure)(NSError *error);
@interface APIClient : NSObject




+ (APIClient *)sharedInstance;

/**
 *  网络是否可用
 *
 *  @return 网络状态
 */

- (BOOL)isNetOk;

@end
